<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <f:metadata>  
        <f:event type="preRenderView" listener="#{sessionBean.authenticate()}"/>
    </f:metadata>

    <f:view id="view" contentType="text/html">


        <h:head id="head">
            <title><ui:insert id="title" name="title">Default Title</ui:insert></title>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <link href="./resources/css/default.css" rel="stylesheet" type="text/css" />
            <link href="./resources/css/simpleLayout.css" rel="stylesheet" type="text/css" />
            <!--<link href="./resources/ui-lightness/ui-lightness.css" rel="stylesheet" type="text/css" />-->
            <!--            <script type="text/javascript" src="resources/jquery-1.6.2.min.js"></script>-->
            <script type="text/javascript" src="resources/script.js"></script>
            <script type="text/javascript" src="resources/highcharts.js"></script>
            <script type="text/javascript" src="resources/jquery-ui-1.8.14.custom.js"></script>
            <script type="text/javascript" src="resources/jquery-ui-timepicker-addon.js"></script>


            <!--[if IE]>
            <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
            <![endif]-->

            <style>

                .ui-autocomplete {
                    position: absolute;
                    cursor: default;
                }

                .ui-menu {
                    list-style: none;
                    padding: 2px;
                    margin: 0;
                    display: block;
                    float: left;
                }
            </style>
        </h:head>
        <body id="body">
            <!--            <p:tooltip global="true" />-->
            <p:growl id="growl" globalOnly="true" showDetail="true" showSummary="true" autoUpdate="true"/>

            <p:dialog modal="true" widgetVar="processingDialog" resizable="false" closable="false" header="Xin vui lòng chờ">  
                Hệ thống đang xử lý. Xin chờ trong giây lát.
            </p:dialog> 

            <p:ajaxStatus style="width:16px;height:16px; position: fixed;">  
                <f:facet name="start">  
                    <h:graphicImage value="./resources/ui-lightness/images/loading.gif" height="32" width="32"/>  
                </f:facet>  

                <f:facet name="complete">  
                    <h:outputText value="" />  
                </f:facet>  
            </p:ajaxStatus> 

            <div id="pagewidth" >
                <div id="header">
                    <p:panel>
                        <div style="font-size: xx-large; font-weight: bolder; color: #1584de">Dịch vụ 6x71</div>
                        <h:form>
                            <h:outputText value="#{sessionBean.omapUser.username}"/> - <p:commandLink value="Đăng xuất" action="#{sessionBean.logout()}" ajax="false"/>
                        </h:form>
                    </p:panel>
                </div>

                <div id="wrapper" class="clearfix">
                    <div id="leftcol">
                        <h:form id="menuForm">
                            <p:menu style="width: 180px">
                                <p:submenu label="Dịch vụ xổ số">  
                                    <p:menuitem value="Tra cứu KQXS" ajax="false" action="lotteryReference?faces-redirect=true" immediate="true"/>  
                                    <p:menuitem value="Cập nhật KQXS" ajax="false" action="updateLotteryTab1-autoWeb?faces-redirect=true" immediate="true"/> 
                                </p:submenu>  
                                <p:submenu label="Hệ thống">  
                                    <p:menuitem value="Monitor yêu cầu" ajax="false" action="queuedRequests?faces-redirect=true" immediate="true"/>  
                                    <p:menuitem value="Điều khiển module" ajax="false" action="moduleControlTab1-manualControl?faces-redirect=true" immediate="true"/>  
                                    <p:menuitem value="Phê duyệt" ajax="false" action="configSubCpApprove?faces-redirect=true" immediate="true"
                                                rendered="#{sessionBean.hasRight('subcp-config-approval', 'view')}"/>
                                    <p:menuitem value="Cấu hình dịch vụ" ajax="false" action="configCau?faces-redirect=true" immediate="true"/>  
                                    <p:menuitem value="Tính toán dịch vụ" ajax="false" action="serviceCalculatorTab1-tinhKet?faces-redirect=true" immediate="true"/>  
                                </p:submenu>
                                <p:submenu label="Báo cáo thống kê">  
                                    <p:menuitem value="Thống kê KQXS" ajax="false" action="lotteryStat?faces-redirect=true" immediate="true"/>  
                                    <p:menuitem value="Hiệu quả quảng bá" ajax="false" action="reportBroadcastEffect?faces-redirect=true" immediate="true"/>  
                                    <p:menuitem value="Đối soát" ajax="false" action="reconcileReport?faces-redirect=true" immediate="true"/>  
                                    <p:menuitem value="Sản lượng" ajax="false" action="productionByShortCode?faces-redirect=true" immediate="true"/>  
                                    <p:menuitem value="MO/MT" ajax="false" action="momtView?faces-redirect=true" immediate="true"/> 
                                </p:submenu>
                                <p:submenu label="Chăm sóc khách hàng">  
                                    <p:menuitem value="Khách hàng tiềm năng" ajax="false" action="potentialCustomersTab1-Mt?faces-redirect=true" immediate="true"/>  
                                    <p:menuitem value="Danh sách sử dụng" ajax="false" action="customerListTab1-ByRegion?faces-redirect=true" immediate="true"/>  
                                    <p:menuitem value="Báo cáo yêu cầu KH" ajax="false" action="requestProcessReport?faces-redirect=true" immediate="true"/>  
                                    <p:menuitem value="Gửi tin trực tiếp" ajax="false" action="sendSms?faces-redirect=true" immediate="true"/> 
                                    <p:menuitem value="Truy vấn giao dịch thẻ" ajax="false" action="transactionQuery?faces-redirect=true" immediate="true"/>   
                                </p:submenu>
                                <p:submenu label="Quản lý OMAP">  
                                    <p:menuitem rendered="#{sessionBean.hasRight('manage-users', 'view')}"
                                                value="Người dùng" ajax="false" action="users?faces-redirect=true" immediate="true"/>  
                                    <p:menuitem rendered="#{sessionBean.hasRight('manage-roles', 'view')}"
                                                value="Nhóm" ajax="false" action="roles?faces-redirect=true" immediate="true" />  
                                    <p:menuitem value="Tài khoản của tôi" ajax="false" action="myAccount?faces-redirect=true" immediate="true"/>
                                    <p:menuitem value="Phân quyền"  rendered="#{sessionBean.hasRight('manage-permissions', 'view')}"
                                                ajax="false" action="permissionTab1-resource?faces-redirect=true" immediate="true"/>
                                    <p:menuitem value="Phiên làm việc"  rendered="#{sessionBean.hasRight('manage-sessions', 'view')}"
                                                ajax="false" action="activeUsers?faces-redirect=true" immediate="true"/>

                                </p:submenu> 
                            </p:menu> 
                        </h:form>
                    </div>
                    <div id="maincol">
                        <p:panel>
                            <div style="font-size: large; font-weight: bolder; color: #1584de"><ui:insert name="title"></ui:insert></div>
                            <br/>
                            <p:messages id="globalMessage" showSummary="false" showDetail="true" autoUpdate="true"/>
                            <ui:insert name="content"></ui:insert>  
                        </p:panel>
                    </div>

                </div>
                <div id="footer">
                    <p:panel>(c) 2011 Thien Loc. All rights reserved.</p:panel>
                </div>
            </div>
        </body>
    </f:view>
</html>